#include "stdafx.h"
#include "GPlayer.h"

GPlayer::GPlayer()
{
	Type = ENTITY_TYPE_PLAYER;
	//Flags = ENTITY_FLAG_GHOST;
}

GPlayer::~GPlayer()
{
}

bool GPlayer::OnLoad(char* File, int Width, int Height, int MaxFrames)
{
	if(GEntity::OnLoad(File, Width, Height, MaxFrames) == false)
	{
		return false;
	}

	return true;
}

void GPlayer::OnLoop()
{
	GFPS::FPSControl.OnLoop();
	GEntity::OnLoop();
}

void GPlayer::OnRender(SDL_Surface* Surf_Display)
{
	GEntity::OnRender(Surf_Display);
}

void GPlayer::OnCleanup()
{
	GEntity::OnCleanup();
}

void GPlayer::OnAnimate()
{
	if(SpeedX != 0 || SpeedY != 0)
	{
		Anim_Control.MaxFrames = 8;
	}
	else
	{
		Anim_Control.MaxFrames = 0;
	}

	GEntity::OnAnimate();
}

bool GPlayer::OnCollision(GEntity* Entity)
{
	return false;
}